package com.jbm.core.server;

import com.jbm.core.client.MainCallback;
import com.jbm.core.common.ConnectAgent;
import com.jbm.onehome.iface.ICertAddress;

/**
 * Created by root on 17-3-3.
 */
public class AccountCallback implements MainCallback
{
	protected SAccount m_sa;

	public AccountCallback()
	{
		m_sa = null;
	}

	public AccountCallback(SAccount sa)
	{
		this();

		m_sa = sa;
	}

	@Override
	public void NewAccount(ConnectAgent ca)
	{
	}

	@Override
	public void RemoveAccount(Integer account_id)
	{
	}

	@Override
	public void UpdateAccount(boolean pullall, ConnectAgent ca)
	{
		m_sa.PushCA2Contact(pullall,m_sa.getM_account_id(),ca);
	}

	@Override
	public void OfflineAccount(int status, ConnectAgent ca)
	{
		m_sa.OfflineCA4Contact(m_sa.getM_account_id(),status, ca);
	}

	@Override
	public void NewDevice( ConnectAgent ca )
	{
	}

	@Override
	public void RemoveDevice( Integer account_id )
	{
	}

	@Override
	public void UpdateDevice( boolean pullall, ConnectAgent ca )
	{
		m_sa.PushCA2Contact(pullall,m_sa.getM_account_id(),ca);
	}

	@Override
	public void OfflineDevice( ConnectAgent ca )
	{
		m_sa.OfflineCA4Contact(m_sa.getM_account_id(),0,ca);
	}

	@Override
	public void NewText(Integer account_id, String text )
	{
	}

	@Override
	public void GPConfirmStart( int cg_id )
	{
		System.out.println("GPConfirmStart cg_id = "+cg_id);
	}

	@Override
	public void GPSelectCertAddress (int cg_id, ICertAddress[] ca)
	{
		System.out.println("GPConfirmStart count = "+ca.length+"0:"+ca[0].gi_text+"1:"+ca[1].gi_text+"2:"+ca[2].gi_text);
	}

	@Override
	public void GPSelectCatalog (int cg_id, String[] catalog)
	{
		System.out.println("GPSelectCatalog count = "+catalog.length+"0:"+catalog[0]+"1:"+catalog[1]+"2:"+catalog[2]);
	}

	@Override
	public void GPSelectTeam (int cg_id, String[] team)
	{
		System.out.println("GPSelectTeam count = "+team.length+"0:"+team[0]+"1:"+team[1]+"2:"+team[2]);
	}
}